﻿namespace RuoYi.Framework.ObjectMapping;

/// <summary>
/// 自动对象映射提供者
/// </summary>
public interface IObjectMapper
{
    /// <summary>
    /// 自动对象映射提供者
    /// </summary>
    IAutoObjectMappingProvider AutoObjectMappingProvider { get; }

    /// <summary>
    /// 自动映射
    /// </summary>
    /// <typeparam name="TSource"></typeparam>
    /// <typeparam name="TDestination"></typeparam>
    /// <param name="source"></param>
    /// <returns></returns>
    TDestination Map<TSource, TDestination>(TSource source);

    /// <summary>
    /// 自动映射
    /// </summary>
    /// <typeparam name="TSource"></typeparam>
    /// <typeparam name="TDestination"></typeparam>
    /// <param name="source"></param>
    /// <param name="destination"></param>
    /// <returns></returns>
    TDestination Map<TSource, TDestination>(TSource source, TDestination destination);
}
